package doh.util;

import java.io.Serializable;

public class GamePlayer implements Serializable {
    public String name;     // name of the player
    public int rock;        // number of rocks thrown
    public int paper;       // number of paper thrown
    public int scissor;     // number of scissors thrown


    /**
     * Initialize with default values
     * @param n The name of the player
     */
    public GamePlayer(String n) {
        name = n;
        rock = 0;
        paper = 0;
        scissor = 0;
    }

    /**
     * Another constructor with name and specified values.
     * @param n Player name
     * @param r # of rocks thrown
     * @param p # of paper thrown
     * @param s # of scissors thrown
     */
    public GamePlayer(String n, int r, int p, int s) {
        name = n;
        rock = r;
        paper = p;
        scissor = s;
    }

    /**
     * Gets the name of this game player.
     * @return String containing the player's name.
     */
    public String getName() {
        return name;
    }

    /**
     * Add one more rock throw to the player's current game stats.
     */
    public void incRock() {
         rock++;
    }

     /**
     * Add one more paper throw to the player's current game stats.
     */
    public void incPaper() {
         paper++;
    }

     /**
     * Add one more scissor throw to the player's current game stats.
     */
    public void incScissor() {
         scissor++;
    }

    /**
     * Get the # of rocks the player has thrown this game.
     * @return The count of rocks thrown.
     */
    public int getRock() {
        return rock;
    }

    /**
     * Get the # of paper the player has thrown this game.
     * @return The count of paper thrown.
     */
    public int getPaper() {
        return paper;
    }

    /**
     * Get the # of scissors the player has thrown this game.
     * @return The count of scissors thrown.
     */
    public int getScissor() {
        return scissor;
    }
}
